package Test;

import Dao.Implement.adminDaoImplement;
import Dao.adminDao;
import Service.Implement.adminServiceImplement;
import Service.adminService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import pojo.stadium;
import returnDataStruct.adminData;
import returnDataStruct.locationListData;
import returnDataStruct.orderListData;

import static org.junit.Assert.*;

public class adminServiceImplementTest {
    private adminService adminServiceGot(){
        ApplicationContext applicationContext=new ClassPathXmlApplicationContext("bean1.xml");
        return (adminService) applicationContext.getBean("adminServiceImplement");
    }

    @Test
    public void queryAdminId(){
        adminService adminService=adminServiceGot();
        System.out.println(new adminData(adminService.queryAdminByID("a1570670347")));
    }
    @Test
    public void queryStadiums(){
        adminService adminService=adminServiceGot();
        System.out.println(new locationListData(adminService.queryForStadiums("a1570670347")));
    }
    @Test
    public void queryRoom(){
        adminService adminService=adminServiceGot();
        System.out.println(adminService.queryRoomByPeriod("2022-11-05","a1570670347"));
    }

}